package day04;
/*
    输出100-200的水仙花数
 */
public class ForDemo5 {
    public static void main(String[] args){

        int number ;
        int units;
        int decade;
        int hundreds;
        int sum = 0;
        int count = 0;

        for(number = 100;number<=1000;number++){
            units = number % 10;
            decade = (number / 10)%10;
            hundreds = (number / 100)%10;

            units = units*units*units;
            decade = decade*decade*decade;
            hundreds = hundreds*hundreds*hundreds;
            sum=units+decade+hundreds;

            if(number==sum){
                count++;
                System.out.println(number);
            }
        }

        System.out.println("水仙花数目："+count);


    }
}
